﻿using Swashbuckle.AspNetCore.Swagger;
using Swashbuckle.AspNetCore.SwaggerGen;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace lingopen.Jabil.Server.Swagger
{
    public class DynamicApiDocumentFilter : IDocumentFilter
    {
        public void Apply(SwaggerDocument swaggerDoc, DocumentFilterContext context)
        {
            Dictionary<string, string> tags = new Dictionary<string, string>();
            tags.Add("R8", "西软R8接口"); 
            //自行匹配自己的Controller名字即可
            swaggerDoc.Tags = new List<Tag>();
            foreach (var c in tags)
            {
                swaggerDoc.Tags.Add(new Tag() { Name = c.Key, Description = c.Value });
            }

        }
    }
}
